// JavaScript Document
$(document).ready(function(){
  	
	$('.mediaelm_listed .detailview').hide();
	
	$('.mediaelm_listed .head').click(function(e) {
		
		e.preventDefault();
		
		var field=$(this).parent().find(".detailview");
		var isopen=$(this).attr('isopen');
		
		
		if(isopen=="true"){
			field.hide();
			
			$(this).attr('isopen',"false");
		}else{
			var id=$(this).attr("id");
			var url=baseurl+"ajaxview";
			$(this).attr('isopen',"true");
			field.show();
			field.html("loading data...");	
			$.post(url,{mediaid:id, viewfile:"media/medialist_single"},	  
			function(data){
				field.html(data);	
			 });
		}
	});	

	/*		
	$(".selectall").click(function(e) {
			$("#'.$field.'").find("input:checkbox").attr("checked", true);
		});
	
	$(".deselectall").click(function(e) {
		$("#'.$field.'").find("input:checkbox").attr("checked", false);
	});
	*/
	
});